﻿namespace On_Demand_Remote_Computing.Web.Infrastructure
{
    using System.Data.Entity;
    using System.Data.Entity.ModelConfiguration.Conventions;
    using On_Demand_Remote_Computing.Web.Models;

    // Summary:
    //     Sample Entity Framework 4.1 context class intended for connecting with SQL Azure.
    //     Place a DbSet<T> property for each collection of entities that should be queried from the database.
    public class SqlSampleDataContext : DbContext
    {
        public SqlSampleDataContext()
            : base(ConfigReader.GetConfigValue("SqlSampleDataContextConnectionString"))
        {
        }

        public DbSet<SqlSampleData> SqlSampleData { get; set; }

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            modelBuilder.Conventions.Remove<PluralizingEntitySetNameConvention>();
            modelBuilder.Conventions.Remove<PluralizingTableNameConvention>();
        }
    }
}